import http from '@/utils/request.js'

export default {
    add: {
        name: '添加文章',
        url: `${import.meta.env.VITE_API_URL}/article/add`,
        async post (data) {
            return await http.post(this.url, data)
        },
    },
    update: {
        name: '更新文章',
        url: `${import.meta.env.VITE_API_URL}/article/update`,
        async post (data) {
            return await http.post(this.url, data)
        },
    },

    setStatus:{
        name: '设置文章状态',
        url: `${import.meta.env.VITE_API_URL}/article/setStatus`,
        async post (data) {
            return await http.post(this.url, data)
        },
    },

    list: {
        name: '获取文章列表',
        url: `${import.meta.env.VITE_API_URL}/article/list`,
        async get (data) {
            return await http.get(this.url, data)
        }
    },
    details: {
        name: '获取文章详情',
        url: `${import.meta.env.VITE_API_URL}/article/details`,
        async get (data) {
            return await http.get(this.url, data)
        }
    },
    dels: {
        name: '删除文章项',
        url: `${import.meta.env.VITE_API_URL}/article/dels`,
        async post (data) {
            return await http.post(this.url, data)
        },
    }
}
